package cn.yto.print.enums;

import lombok.Getter;

@Getter
public enum PrintCmdEnum {

    /* 操作命令枚举 */
    GET_PRINTER("getPrinters", "获取打印机"),
    PRINT("print", "面单打印"),
    STATUS("status", "获取打印组件连接状态"),
    VERSION("version", "获取小助手当前版本"),
    NOTIFY_PRINT_RESULT("notifyPrintResult", "打印结果通知");

    private final String cmd;
    private final String desc;

    PrintCmdEnum(String cmd, String description) {
        this.cmd = cmd;
        this.desc = description;
    }

    public static PrintCmdEnum getPrintCmd(String cmd) {
        for (PrintCmdEnum value : PrintCmdEnum.values()) {
            if (value.getCmd().equals(cmd)) {
                return value;
            }
        }
        return null;
    }

}
